// 通用样式
@import './style/index.scss';
// 全局加载动画
@import './global-loading.scss';
// 兼容
@import './compatible.scss';
// elementui 暗黑模式css变量
@import './theme.scss';

:root {
  --layout-min-width: 1024px;
  --layout-min-height: auto;
  --layout-aside-collapse-width: 64px;
  --layout-aside-width: 260px;
  --layout-header-height: 50px;
  --layout-navigation-height: 50px;
  --layout-system-menu-width: 88px;
  //   ------------------覆盖el默认变量---------------------
  --el-bg-color-page: #eff2f7 !important;
  // --el-bg-color-page: #f2f2f2;
  //   ---------------------------------------
  --el-bg-color-rgb: 255, 255, 255;


  --motion-ease-in-back: cubic-bezier(0.71, -0.46, 0.88, 0.6);
  --motion-ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1);
  --motion-ease-in-out-circ: cubic-bezier(0.78, 0.14, 0.15, 0.86);
  --motion-ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06);
  --motion-ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
  --motion-ease-out-back: cubic-bezier(0.12, 0.4, 0.29, 1.46);
  --motion-ease-out-circ: cubic-bezier(0.08, 0.82, 0.17, 1);
  --motion-ease-out-quint: cubic-bezier(0.23, 1, 0.32, 1);
  --motion-bezier: cubic-bezier(0.4, 0, 0.2, 1);

  --layout-header-height: 50px;
  --layout-main-bgc: #eff2f7;
  --layout-container-bgc: var(--el-bg-color-overlay);
  --layout-gap-sm: 16px;
  --layout-gap-xs: 10px;
  --layout-border-color: #e4e7ed;
  --layout-border-radius: 4px;
}
*,*::before,*::after {
  box-sizing: border-box;
}
html,
body,
#app {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: "Segoe UI", system-ui, sans-serif;
}

//#region 页面大小
#app {
  min-width: var(--layout-min-width);
  min-height: var(--layout-min-height);
}

body {
  @include roll();
}

fieldset {
  border: 1px solid var(--el-border-color);

  legend {
    color: var(--el-text-color-primary);
  }
}

@media screen and (max-width: 1024px) {
  body {
    overflow-y: hidden;
    overflow-x: auto;
  }
}

// @media screen and (max-height: 768px) {
//   body {
//     overflow-y: auto;
//     overflow-x: hidden;
//   }
// }

// @media screen and (max-width: 1024px)and (max-height: 768px) {
//   body {
//     overflow: auto;
//   }
// }

//#endregion

//#region 自定义
.table-highlight {
  td {
    background-color: var(--el-color-primary-light-9) !important;
  }
}

// 自定义模态框样式
.custom-modal {
  background-color: rgba(231, 229, 228, 0.1);
  backdrop-filter: blur(2px);
}

.custom-dialog {
  min-width: 640px;

  &.radius {
    border-radius: 10px;
  }

  &.reset-padding {

    .el-dialog__header,
    .el-dialog__body {
      padding: 0;
    }
  }

  &.hide-header .el-dialog__header {
    display: none;
  }
}

//#endregion
.el-overlay-dialog {
  @include roll();
}

// 页面容器=>单个页面，统一input宽度
.container {
  background-color: var(--el-bg-color);
  box-sizing: border-box;

  &.fill {
    margin: -20px;
    width: calc(100% + 40px) !important;
    height: calc(100% + 40px) !important;
  }

  .panel {
    @extend .flex-incompressible;
    --panel-width: 300px;
    background-color: var(--el-bg-color);
    border: 1px solid var(--el-border-color-light);
    border-radius: 4px;
    transition: all var(--motion-bezier) 0.3s;
    width: var(--panel-width);

    &:hover {
      box-shadow: 0 8px 32px #0000000d;
    }

    &-header {
      color: var(--el-text-color-primary);

      &__title {}
    }

    &-list {
      @extend .width-fill, .margin-0, .padding-0, .text-Abc;
      list-style-type: none;
      color: var(--el-text-color-regular);

      &>li {
        cursor: pointer;
        padding: 8px 12px;
        line-height: 1.2;
        font-size: .9rem;
        border-radius: 6px;
        transition: all 0.3s;
      }

      &>li:hover,
      &>li:active,
      &>li.active {
        color: var(--el-color-primary);
        background-color: var(--el-fill-color-lighter);
      }

      &>li:active,
      &>li.active {
        font-weight: bold;
        background-color: var(--el-color-primary-light-9);
        filter: opacity(0.8);

      }
    }
  }

  a {
    color: var(--el-color-primary);
  }

  .container-header {
    border-left: 4px solid var(--el-color-primary);
  }

  .container-tip {
    color: var(--el-text-color-disabled);
    font-size: 14px;
  }

  .el-tabs__content {
    height: 100%;
  }

  .el-table {
    --el-table-header-bg-color: var(--el-bg-color-page);

    &__footer {
      td {
        background-color: var(--el-table-row-hover-bg-color) !important;
      }
    }

    :not(.is-left).el-table__cell .cell {
      text-align: center;
    }

    .custom_amount_row.warning td {
      background-color: var(--el-color-warning-light-9) !important;
    }

    .custom_amount_row.primary td {
      background-color: var(--el-color-primary-light-9) !important;
    }

    // 自定义区域合计行样式
    .custom_region_row td {
      background-color: var(--el-color-error-light-9) !important;
    }

    .el-input-number:not(.free),
    .el-date-editor:not(.free),
    .el-textarea__inner:not(.free),
    .el-input:not(.el-pagination__editor):not(.free),
    .el-select:not(.free) .el-input:not(.el-pagination__editor) {
      box-sizing: border-box;
      min-width: 80px;
    }

  }

  .el-input-number:not(.free),
  .el-select:not(.free),
  .el-date-editor:not(.free),
  .el-textarea__inner:not(.free),
  .el-input:not(.el-pagination__editor):not(.free) {
    box-sizing: border-box;
    min-width: 240px;
  }

  .el-input-number.free {
    .el-input {
      min-width: auto;
    }
  }

  .el-select.free [class].el-input {
    min-width: 80px;
  }

  .el-form-item.min-width-auto .el-input {
    min-width: auto;
  }



  .el-pagination {
    .el-pagination__sizes {
      .el-select {
        min-width: 128px !important;
      }
    }
  }
}

.el-dialog .el-form .el-input-number,
.el-dialog .el-form .el-date-editor,
.el-dialog .el-form .el-textarea__inner,
.el-dialog .el-form .el-input:not(.el-pagination__editor) {
  width: 100%;
}

.el-dialog__header {
  .el-input {
    box-sizing: border-box;
    min-width: 140px;
  }
}


// 点位、指标管理
.container .view-tree,
.container .view-manage {
  height: 100%;
}

.container .view-tree {
  position: relative;
  z-index: 9;
  flex: 0 0 auto;
  width: var(--container-left-width, 240px);
  border: 1px solid var(--el-border-color-light);
  border-radius: var(--layout-border-radius);
  padding: var(--layout-gap-sm, 1rem);
  display: flex;
  flex-direction: column;
  gap: var(--layout-gap-xs, 10px);
  transition: all 0.3s;
}

.container .view-tree:hover {
  box-shadow: 0 8px 32px #0000000d;
}

.container .view-tree .tree-tools {
  margin-left: auto;
  margin-right: 10px;
  opacity: 0;
  transition: all 0.3s;
}

.container .view-tree .custom-tree-node {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
}

.container .view-tree .custom-tree-node {
  margin-left: auto;
}

.container .view-tree .custom-tree-node:hover .tree-tools {
  opacity: 1;
}
.container .view-tree {
  .el-tree > .el-tree-node {
    display: inline-block;
    min-width: 100%;
  }
}

.container .view-manage {
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--layout-gap-sm, 1rem);
}

.fade-enter-from {
  opacity: 0;
}

.fade-enter-active {
  transition: opacity 0.6s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.container .view-manage .el-form {
  flex: 0 0 auto;
}

.container .view-manage .el-table {
  flex: 1 1 auto;
}

.relative {
  position: relative;
}

.shape {
  padding: 2px;
  width: 20px;
  /* aspect-ratio: 1; */
  height: 20px;

  /* box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1); */
  margin-right: 8px;
  border: 1px solid;
}

.shape.rounded-rect {
  border-radius: 4px;
}

.shape.elliptic {
  border-radius: 10px / 5px;
  height: 10px;
}

.el-table {
  --el-table-header-bg-color: var(--el-bg-color-page);

  .el-input[class]:not(.free) {
    box-sizing: border-box;
    width: 100px;
  }
}

// ================useDefineLoading hook 自定义loading 样式 ==================
[class].global-loading {
  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(5px);
}

// ================element ui默认样式修改 ==================
// 对后端返回字符串处理
.el-message {
  &__content {
    white-space: pre-wrap;
  }
}

// 隐藏时间范围选择器 秒
[class].reset.el-popover {
  padding: 0px;
  box-shadow: var(--el-box-shadow-light);
}

[class].el-dialog {
  --el-dialog-padding-primary: 14px;

  &__header {
    margin-right: 0px;
  }

  &__body {
    max-height: 50vh;
    overflow-x: hidden;
    overflow-y: auto;
    $thumbColor: rgba(0, 0, 0, 0.1);
    scrollbar-width: thin;
    &::-moz-scrollbar,
    &::-webkit-scrollbar {
      width: 12px;
      height: 12px;
    }
    &::-moz-scrollbar-track,
    &::-webkit-scrollbar-track {
      background-clip: padding-box;
      border: solid transparent;
      border-width: 1px;
    }
  
    &::-moz-scrollbar-corner, 
    &::-webkit-scrollbar-corner {
      background-color: transparent;
    }
  
    &::-moz-scrollbar-thumb,
    &::-webkit-scrollbar-thumb {
      background-color: $thumbColor;
      background-clip: padding-box;
      border: solid transparent;
      border-radius: 10px;
    }
  }

}

[class].el-dialog:not(.reset) {

  .el-dialog__body {
    padding-top: 10px;
    padding-bottom: 10px;
    border-top: 1px solid var(--el-border-color-lighter);
    border-bottom: 1px solid var(--el-border-color-lighter);
  }

}

[class][class].el-overlay {
  @extend .custom-modal;
}

.el-drawer {
  &__header {
    color: var(--el-text-color-primary);
    margin-bottom: 24px;
  }

  &__title {
    font-weight: bold;
    font-size: 18px;
  }

  &__close-btn {
    color: var(--el-text-color-primary);
    font-weight: bold;
  }


  &__body {
    @include roll();
    border-top: 1px solid var(--el-border-color-lighter);
    border-bottom: 1px solid var(--el-border-color-lighter);
  }
}

.img-fluid {
  max-width: 100%;
}

.clearfix {
  &::after {
    content: '';
    display: table;
    clear: both;
  }
}
.roll {
  @include roll();
}

.flex-1 {
  flex: 1;
}
.cursor-pointer {
  cursor: pointer;
}
.text-regular {
  color: var(--el-text-color-regular);
}
.text-placeholder {
  color: var(--el-text-color-placeholder);
}
.text-sedonary {
  color: var(--el-text-color-sedonary);
}
.ggg-checkbox {
  .el-checkbox__inner {
    --el-checkbox-input-border: 1px solid var(--el-color-danger);
  }
  .el-checkbox__inner:hover {
    --el-checkbox-input-border-color-hover: var(--el-color-danger);
  }
  .el-checkbox__input.is-checked .el-checkbox__inner {
    --el-checkbox-checked-bg-color: var(--el-color-danger);
    --el-checkbox-checked-input-border-color: var(--el-color-danger);
  }
  .el-checkbox__label {
    color: var(--el-color-danger);
    --el-checkbox-checked-text-color: var(--el-color-danger);
  }
}